<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
    <base href="<%=basePath%>">
	<link rel="stylesheet" type="text/css" href="bootstrap-rs/themes/black/easyui.css">
	<link rel="stylesheet" type="text/css" href="bootstrap-rs/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="bootstrap-rs/demo.css">
	<script type="text/javascript" src="bootstrap-rs/jquery.min.js"></script>
	<script type="text/javascript" src="bootstrap-rs/jquery.easyui.min.js"></script>
</head>
<body>
	<div style="padding:3px 2px;border-bottom:1px solid #ccc">添加规则</div>
	<form id="ff" action="rule/info/save" method="post">
		<table border="1">
			<tr>
				<td>品牌</td>
				<td>
					<select id="brand" name="gradeRule.nBrandid">
						<option value="0">--请选择--</option>
						<c:forEach var="brand" items="${brandList }" varStatus="status">
						<option id="nBrandid" name="gradeRule.nBrandid" value="${brand.nBrandid} " >${brand.vBrandname}</option>
						</c:forEach>
					</select>				
				</td>
			</tr>
			<tr>
				<td>等级</td>
				<td>
					<select id="grade" name="gradeRule.nGradeid">
						<option value="0">--请选择--</option>
						<c:forEach var="grade" items="${gradeList }" varStatus="status">
						<option  id="nGradeid" name="gradeRule.nGradeid" value="${grade.nGradeid}" >${grade.vGrade}</option>
						</c:forEach>
					</select>				
				</td>
			</tr>
			<tr>
				<td>规则名称</td>
				<td><input name="gradeRule.vRulename" type="text"></input></td>
			</tr>
			<tr>
				<td>优先级</td>
				<td><input name="gradeRule.nPriority" type="text"></input>
				<span style="color:red">提示，数字高的等级高</span></td>
			</tr>
			<tr>
				<td>计算系数</td>
				<td><input name="gradeRule.nFactor" type="text"></input></td>
			</tr>
			<tr>
				<td>描述</td>
				<td><input name="gradeRule.vDesc" type="textarea"></input></td>
			</tr>
			<tr>
				<td>类型1</td>
				<td>话费</td>
			</tr>
			<tr>
				<td>条件</td>
				<td name="gradeRule.nCondition1">一次性预存话费
				<input name="money" type="text"></input>元；</br>连续
				<input name="month" type="text"></input>个月内，平均每个月消费
				<input name="cost" type="text"></input>月
				</td>
			</tr>
			<tr>
				<td>类型2</td>
				<td>积分</td>
			</tr>
			<tr>
				<td>条件</td>
				<td name="gradeRule.nCondition2">连续
				<input name="month_intf" type="text"></input>个月内累积积分达到
				<input name="intfs" type="text"></input>以上
				</td>
			</tr>
			<tr>
				<td colspan="2" align="center"><input type="submit" value="提交"></input></td>
			</tr>
		</table>
	</form>

<div class="inline pull-right page">
	<!-- basePage没有作用 -->
	<jsp:include page="/pageBar.jsp"></jsp:include>
</div>
</body>
<script type="text/javascript">

function chooseBrand(opt){
	window.location.href ="/rule/info/queryByBrand?brandName="+opt.options[opt.selectedIndex].value;
}

function chooseGrade(opt){
	window.location.href ="/rule/info/queryByGrade?gradeName="+opt.options[opt.selectedIndex].value;
}

function queryByName(){
	window.location.href = "rule/info/queryByName?brandName="+
			$('#brand').val()+"&gradeName="+$('#grade').val();
}


</script>
</html>